package com.liu.queue.storage;


import com.liu.queue.message.PushMessage;
import com.liu.queue.message.MessageTypeEnum;
import com.liu.queue.message.StoragePushMessage;

import java.util.List;

/**
 * @param
 * @BelongsProject: QueueDemo2
 * @BelongsPackage: com.liu.queue.cache
 * @author: L
 * @Date: 2023/10/17 10:13
 * @return
 *
 * 实现类必须有空参构造器
 */

public interface Storage {
    // 缓存
    void cache(PushMessage pushMessage);
    // 判断处理
    boolean support(MessageTypeEnum messageType);
    // 从缓存获取
    List<StoragePushMessage> get(byte[] topic, Integer total);

    // 持久化
    void persistence(PushMessage msg);

    List<PushMessage> getByDisk();
}
